<?php
/* Smarty version 4.5.5, created on 2025-05-12 17:39:57
  from 'E:\Develop\php\projects\app\view\admin\web\single_add.html' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.5',
  'unifunc' => 'content_6821c1ed4d5013_61642235',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '1da82c915fd35771042521f0de1f150d1b5380cf' => 
    array (
      0 => 'E:\\Develop\\php\\projects\\app\\view\\admin\\web\\single_add.html',
      1 => 1728555554,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_6821c1ed4d5013_61642235 (Smarty_Internal_Template $_smarty_tpl) {
?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['index']['title'];?>
</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="/static/lay/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/lay/layui/index.css" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
        <form name="addItem" method="post" lay-filter="component-form-group" class="layui-form">
          <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['id'];?>
" name="id">
            <div class="layui-form-item">
              <div class="layui-inline">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['name'];?>
</label>
              <div class="layui-input-inline">
               <input type="text" name="title" lay-verify="title" value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['title'];?>
" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" autocomplete="off" class="layui-input" />
              </div>
              </div>
              
              <div class="layui-inline">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['ident'];?>
</label>
              <div class="layui-input-inline">
               <input type="text" name="acode" id='acode' lay-verify="acode" value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['acode'];?>
" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" autocomplete="off" class="layui-input" />
              </div>
            </div>
          </div>

          <div class="layui-form-item showfk">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['langinfo'];?>
</label>
              <div class="layui-inline" id="submue"  style="width:80%;">
                <table class="layui-table" id="sharetable" lay-filter="table">
                <thead>
                    <tr>
                        <td width='15%'><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['lang'];?>
</td>
                        <td width='20%'><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['title'];?>
</td>
                        <td width='55%'><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['blurb'];?>
</td>
                        <td width='10%'><a class="layui-btn layui-btn-xs addshare"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['add'];?>
</a></td>
                    </tr>
                </thead>
                <tbody>
                    <?php if (empty($_smarty_tpl->tpl_vars['diInfo']->value['langinfo'])) {?>
                    <tr>
                      <td>
                        <select name="langs[]">
                          <option value=""><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>
                          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['langs']->value['list'], 'item');
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
                          <option value="<?php echo $_smarty_tpl->tpl_vars['item']->value['value'];?>
"><?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</option>
                          <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </select>
                      </td>
                      <td><input type="text" name="titles[]" value="" class="layui-input" lay-verify="title"></td>
                      <td><textarea  name="introduction[]" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" class="layui-input" lay-verify="introduction"></textarea></td>
                      <td><a class="layui-btn layui-btn-danger layui-btn-xs delshare"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['del'];?>
</a></td>
                    </tr>
                     <?php } else { ?>
                     <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['diInfo']->value['langinfo'], 'item', false, 'key');
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
                    <tr>
                      <td>
                        <select name="langs[]">
                          <option value=""><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>
                          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['langs']->value['list'], 'items');
$_smarty_tpl->tpl_vars['items']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['items']->value) {
$_smarty_tpl->tpl_vars['items']->do_else = false;
?>
                          <option value="<?php echo $_smarty_tpl->tpl_vars['items']->value['value'];?>
" <?php if ($_smarty_tpl->tpl_vars['key']->value == $_smarty_tpl->tpl_vars['items']->value['value']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['items']->value['name'];?>
</option>
                          <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </select>
                      </td>
                      <td><input type="text" name="titles[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['titles'];?>
" class="layui-input" lay-verify="title"></td>
                      <td><textarea name="introduction[]" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" class="layui-input" lay-verify="introduction"><?php echo $_smarty_tpl->tpl_vars['item']->value['introduction'];?>
</textarea></td>
                      <td><a class="layui-btn layui-btn-danger layui-btn-xs delshare"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['del'];?>
</a></td>
                    </tr>
                     <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                     <?php }?>
                  </tbody>
                </table>
              </div>
            </div>
        
            <div class="layui-form-item" >
            <div class="layui-inline">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['type'];?>
</label>
              <div class="layui-input-block">
                <input type="radio" name="type" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['single'];?>
" lay-filter="type" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['type'] == 1) {?> checked<?php }?>>&nbsp;&nbsp;<input type="radio" name="type" value="2" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['list'];?>
" lay-filter="type" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['type'] == 2) {?> checked<?php }?>>
              </div>
            </div>
            <div class="layui-inline guisu" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['type'] != 1) {?>style="display:none"<?php }?>>
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['higher'];?>
</label>
              <div class="layui-input-block">
                <select name="sid">
                  <option value=0><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>
                  <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['sidinfo']->value, 'item');
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
                  <option value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['sid'] == $_smarty_tpl->tpl_vars['item']->value['id']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
</option>
                  <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
              </div>
            </div>
          </div>

          <div class="layui-form-item">

            <div class="layui-inline">
            <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['sort'];?>
</label>
            <div class="layui-input-inline">
              <input type="text" name="orderid"  lay-verify="orderid"  value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['orderid'];?>
" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-inline danye"  <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['type'] != 1) {?>style="display: none"<?php }?>>
            <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 ID</label>
            <div class="layui-input-inline">
              <select name="dcssid">
                <option value=0><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>
                <option value=1 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 1) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 一</option>
                <option value=2 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 2) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 二</option>
                <option value=3 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 3) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 三</option>
                <option value=4 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 4) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 四</option>
                <option value=5 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 5) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 五</option>
              </select>
            </div>
          </div>

          <div class="layui-inline liebiao" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['type'] != 2) {?>style="display: none"<?php }?>>
            <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 ID</label>
            <div class="layui-input-inline">
              <select name="lcssid">
                <option value=0><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>
                <option value=1 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 1) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 一</option>
                <option value=2 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 2) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 二</option>
                <option value=3 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 3) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 三</option>
                <option value=4 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 4) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 四</option>
                <option value=5 <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['cssid'] == 5) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['style'];?>
 五</option>
              </select>
            </div>
          </div>

          </div>

            <div class="layui-form-item">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['addr'];?>
</label>
              <div class="layui-input-inline" style="width:50%;">
                <input type="text" name="url" id="url" value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['url'];?>
" lay-verify="url" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" autocomplete="off" class="layui-input" />
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['vaddr'];?>
</label>
              <div class="layui-input-inline" style="width:50%;">
                <input type="text" name="videourl" value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['videourl'];?>
"  placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" autocomplete="off" class="layui-input" />
              </div>
              <div class="layui-inline">
                <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['show'];?>
</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_video" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['no'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['is_video'] == 1) {?> checked<?php }?>  >&nbsp;&nbsp;<input type="radio" name="is_video" value="2" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['yes'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['is_video'] == 2) {?> checked<?php }?>>
                </div>
              </div>
            </div>
            <div class="layui-form-item">
                 <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['openpage'];?>
</label>
                 <div class="layui-input-block">
                 <input type="radio" name="is_target" value="0" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['no'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['is_target'] == 0) {?> checked<?php }?>  >&nbsp;&nbsp;<input type="radio" name="is_target" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['yes'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['is_target'] == 1) {?> checked<?php }?>>
                </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['img'];?>
</label>
              <div class="layui-inline">
                <div class="layui-upload">
                  <div class="layui-upload-drag" id="upload">
                    <i class="layui-icon"></i>
                  </div>
                  
                  <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                    <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['smallimg'];?>
： <div class="layui-upload-list" id="images">
                      <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['diInfo']->value['imgurls'], 'item');
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
                      <img id="" src="<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
" onclick="xadmin.imgOpen({url:'<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
'});" style="width:100px; height: 50px"/>
                      <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                    </div>
                  </blockquote>
                  <p id="tipTxt"></p>
                </div>
                <input id="imgurl" name="imgurl" value="<?php echo $_smarty_tpl->tpl_vars['diInfo']->value['imgurl'];?>
" type="hidden" lay-verify="imgurl" />
              </div>
            </div>

            <div class="layui-form-item">
              <div class="layui-inline">
                <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['status'];?>
</label>
                <div class="layui-input-block">
                  <input type="radio" name="status" value="0" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['close'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['status'] == 0) {?> checked<?php }?>  >&nbsp;&nbsp;<input type="radio" name="status" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['normal'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['status'] == 1) {?> checked<?php }?>>
                </div>
              </div>
              <div class="layui-inline">
                <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['inshow'];?>
</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_index" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['no'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['is_index'] == 1) {?> checked<?php }?>  >&nbsp;&nbsp;<input type="radio" name="is_index" value="2" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['yes'];?>
" <?php if ($_smarty_tpl->tpl_vars['diInfo']->value['is_index'] == 2) {?> checked<?php }?>>
                </div>
              </div>
            </div>

          <div class="layui-form-item layui-layout-admin">
            <div>
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" type="button" id="submit" lay-submit lay-filter="submit"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['submit'];?>
</button>
                <button type="reset" class="layui-btn layui-btn-primary"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['reset'];?>
</button>
                <button type="button" class="layui-btn layui-btn-primary" onClick="xadmin.close();" ><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['back'];?>
</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>

</body>
</html>
  <?php echo '<script'; ?>
 src="/static/lay/layui/layui.js"><?php echo '</script'; ?>
>
  <?php echo '<script'; ?>
 type="text/javascript">
    var multiple_images = [];
    layui.config({
     base: '/static/lay/' //静态资源所在路径
   }).extend({
     xadmin: 'lib/xadmin' //弹窗
   }).use(['jquery', 'layer','xadmin', 'form', 'upload'], function(){
    var form = layui.form
        ,$ = layui.jquery
        ,upload = layui.upload;
     form.render(null, 'component-form-group');
     /* 自定义验证规则 */
    form.verify({

      title: function(value){
        if(value.length < 1){
          return '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['nocontent'];?>
';
        }
      }
      ,orderid: [/^[0-9]*$/, '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['sort'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['nocontent'];?>
']
      ,url: function(value){
        if(value.length < 1){
          return '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['addr'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['nocontent'];?>
';
        }
      }

    });

    
    //动态添加表单
    //因为动态添加的元素class属性是无效的，所以不能用
    $('body').on('click', '.addshare', function() {
      if ($('#sharetable tbody tr').length > <?php echo $_smarty_tpl->tpl_vars['langs']->value['total']-1;?>
) {
        layer.msg('<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['moreset'];?>
 <?php echo $_smarty_tpl->tpl_vars['langs']->value['total'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['strip'];?>
', {
            offset: '20px', 
            time : 2000
        });
      }else{
      //添加html
        var html = '<tr>'+
          '<td><select name="langs[]"><option value=""><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>'+
          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['langs']->value['list'], 'item');
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
          '<option value="<?php echo $_smarty_tpl->tpl_vars['item']->value['value'];?>
"><?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</option>'+
          <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
          '</select></td>'+
          '<td><input type="text" name="titles[]" value="" class="layui-input"></td>'+
          '<td><textarea  name="introduction[]" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" class="layui-input" ></textarea></td>'+
          '<td>'+'<a class="layui-btn layui-btn-danger layui-btn-xs delshare"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['del'];?>
</a>'+
          '</td>'+
          '</tr>';
        //添加到表格最后
        $(html).appendTo($('#sharetable tbody:last'));
        form.render();
      }
    });
    $('body').on('click', '.delshare', function() {
      if ($('#sharetable tbody tr').length === 1) {
        layer.msg('<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['onenodel'];?>
', {
            time : 2000
        });
      } else {
        //删除当前按钮所在的tr
        $(this).closest('tr').remove();
      }
    });

    form.on("radio(type)", function (data) {
        var acode = $("#acode").val();
        if (this.value == '1') { 
            $("#url").val('/home/web/single/?acode='+acode)
            $(".guisu").show()
            $(".danye").show()
            $(".liebiao").hide()
        } else if (this.value == '2') { 
            $("#url").val('/home/web/arcate/?acode='+acode)
            $(".guisu").hide()
            $(".danye").hide()
            $(".liebiao").show()
       } 
    })

    form.on('submit(submit)', function (data) {
          $('#submit').attr("disabled",true);
          $('#submit').addClass('layui-btn-disabled');
                $.post('#',data.field,function(res){
                    if(res.code == 200){
                        layer.msg(res.msg);
                        setTimeout(() => {
                          window.parent.location.reload();
                          xadmin.close();
                        }, 1000);
                    }else{
                        layer.msg(res.msg);
                    }
                })
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });
        //图片上传
        var uploadInst = upload.render({ 
          elem: '#upload' //绑定元素 
          ,url: '/admin/common/uploadimg/?folder=single' //上传接口
          ,accept:'images'
          ,exts:'jpg|jpeg|png|gjf|webp|bmp|tif'
          ,drag:false
          ,multiple: true 
          ,number: 6   
          ,auto:true  
          ,bindAction:'#hideUpload'       //绑定真正的上传按钮
          ,allDone: function(obj){
            var txt = "共选择了 【"+obj.total+"】 张图片，其中，上传成功 【"+obj.successful+"】 张，失败 <span style='color:red'>【"+obj.aborted+"】 </span>张";
            $("#tipTxt").html(txt);
          }
          ,before: function(obj){
              //预读本地文件示例，不支持ie8
              $('#images').html('');
              obj.preview(function(index, file, result){
                $('#images').append('<img src="'+ result +'" alt="'+ file.name +'" style="width:100px;height:50px">')
              });
          }
          ,done: function(res){
            multiple_images.push(res.data.src);
            // data=$('#imgurl').val();
            // data=data!=''?(data+','+res.data.src):res.data.src;
            $('#imgurl').attr('value', multiple_images);
            if (res.code == 200) {
              layer.msg('上传完毕', {icon: 1});
            }
          }
          ,error: function(){ 
           //请求异常回调 
          } 
        }); 


  });

  <?php echo '</script'; ?>
><?php }
}
